import { gfetch } from '@/utils/back/fetch';
import HomePage from '@/views/Home';
import { Metadata } from 'next';
import React from 'react';

export const metadata: Metadata = {
  title: " my-company",
};

export default async function HomeRoutePage() {
  const bannerRes = await gfetch<Banner[]>('/public/banners');
  const banners = bannerRes.success ? bannerRes.data : ([] as Banner[]);
  const trendingRes = await gfetch<TrendProduct[]>('/public/trendings');
  const trendings = trendingRes.success
    ? trendingRes.data
    : ([] as TrendProduct[]);
  return <HomePage initData={{ banners, trendings }} />;
}
